package com.second_kill.second_kill_app.pool;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;

/**
 * Created by fangjicai on 2020/4/30.
 */

@Component
public class SecondKillData implements Runnable {
//    @Autowired
//    private RabbitmqTemplate rabbitmqTemplate;
    //用户ID
    private String UserId;
    //商品ID
    private String shopId;

    @Override
    public void run() {
        HashMap<String, String> map = new HashMap<>();
        map.put("userId",this.UserId);
        map.put("shopId",this.shopId);
        //发送消息到mq 以rabbitmq为例
        //rabbitmqTemplate.convertAndSet("second_kill",map);

    }

    public SecondKillData(String userId, String shopId) {
        UserId = userId;
        this.shopId = shopId;
    }

    public SecondKillData() {
    }

    public String getUserId() {
        return UserId;
    }

    public void setUserId(String userId) {
        UserId = userId;
    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }
}
